using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Calculate End Date</para>
    /// <para>Populates the values for a specified end date field with values calculated using the start date field specified. This tool is useful when the intervals between start date field values are not regular and you want to animate the feature class or table through time or some other value using the Animation toolbar.</para>
    /// <para>使用使用指定的开始日期字段计算的值填充指定结束日期字段的值。如果开始日期字段值之间的间隔不规则，并且您希望使用动画 工具条对要素类或表进行随时间或其他值进行动画处理，则此工具非常有用。</para>
    /// </summary>    
    [DisplayName("Calculate End Date")]
    public class CalculateEndDate : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CalculateEndDate()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Table">
        /// <para>Input Table</para>
        /// <para>The feature class or table for which an end date field is calculated based on the start date field specified.</para>
        /// <para>根据指定的开始日期字段计算结束日期字段的要素类或表。</para>
        /// </param>
        /// <param name="_Start_Date_Field">
        /// <para>Start Date Field</para>
        /// <para>The field containing values that will be used to calculate values for the end date field. The start date field and the end date field must be of the same format.</para>
        /// <para>包含将用于计算结束日期字段值的值的字段。开始日期字段和结束日期字段的格式必须相同。</para>
        /// </param>
        /// <param name="_End_Date_Field">
        /// <para>End Date Field</para>
        /// <para>The field that will be populated with values based on the start date field specified. The start date field and the end date field must be of the same format.</para>
        /// <para>将使用基于指定的开始日期字段的值填充的字段。开始日期字段和结束日期字段的格式必须相同。</para>
        /// </param>
        public CalculateEndDate(object _Input_Table, object _Start_Date_Field, object _End_Date_Field)
        {
            this._Input_Table = _Input_Table;
            this._Start_Date_Field = _Start_Date_Field;
            this._End_Date_Field = _End_Date_Field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Calculate End Date";

        public override string CallName => "management.CalculateEndDate";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_Input_Table, _Unique_ID_Fields, _Start_Date_Field, _End_Date_Field, _Output_Table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The feature class or table for which an end date field is calculated based on the start date field specified.</para>
        /// <para>根据指定的开始日期字段计算结束日期字段的要素类或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Table { get; set; }


        /// <summary>
        /// <para>Unique ID Fields</para>
        /// <para>The name of the field or fields that can be used to uniquely identify spatial entities. This field or these fields are used to first sort based on entity type if there is more than one entity. For instance, for a feature class representing population values per state over time, state name could be the unique value field (the entity). If population figures are per county, you would need to set county name and state name as the unique value fields, since some county names are the same for different states. If there is only one entity, this parameter can be ignored.</para>
        /// <para>可用于唯一标识空间实体的一个或多个字段的名称。如果存在多个实体，则此字段或这些字段用于首先根据实体类型进行排序。例如，对于表示每个州随时间变化的人口值的要素类，州名称可以是唯一值字段（实体）。如果人口数字是按县计算的，则需要将县名称和州名称设置为唯一值字段，因为某些县名称对于不同的州是相同的。如果只有一个实体，则可以忽略此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Unique ID Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _Unique_ID_Fields { get; set; } = null;


        /// <summary>
        /// <para>Start Date Field</para>
        /// <para>The field containing values that will be used to calculate values for the end date field. The start date field and the end date field must be of the same format.</para>
        /// <para>包含将用于计算结束日期字段值的值的字段。开始日期字段和结束日期字段的格式必须相同。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Start Date Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Start_Date_Field { get; set; }


        /// <summary>
        /// <para>End Date Field</para>
        /// <para>The field that will be populated with values based on the start date field specified. The start date field and the end date field must be of the same format.</para>
        /// <para>将使用基于指定的开始日期字段的值填充的字段。开始日期字段和结束日期字段的格式必须相同。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("End Date Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _End_Date_Field { get; set; }


        /// <summary>
        /// <para>Output Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _Output_Table { get; set; }


        public CalculateEndDate SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}